/**
 * ...
 * @author Sergey Mamyan
 */

package tx.airclient.dev;

import neko.Lib;
import tx.squirrel.neko.core.handler.FBAppHandler;

class FacebookHandler extends FBAppHandler {

	public function new() {
		super();
		free("default", null, doDefault);
		free("admin", null, doAdmin);
	}
	
	public function doDefault():Void {
		Lib.println('<fb:header decoration="add_border">Air client</fb:header>');
		Lib.println('<div style="padding:5px; text-align:right; background-color:#efefef; border-bottom:1px solid #e5e5e5;"><a href="http://apps.carracoo.net/?SID='+session.id+'" target="blank">Admin</a><a href="http://localhost/?SID='+session.id+'" target="blank">Admin Local</a></div>');
		Lib.println('<pre>');
		trace(user);
		trace(app);
		trace(session);
		Lib.print('</pre>');
	}
	
	public function doAdmin():Void {
		Lib.println('<fb:redirect url="http://apps.carracoo.net/?SID='+session.id+'"/>');
	}
}